# encoding: utf-8
"""
Serialization schemas for Redises resources RESTful API
----------------------------------------------------
"""

from flask_marshmallow import base_fields

from app.extensions.api.results import BaseResultSchema
from flask_restplus_patched import ModelSchema
from .models import Redis


class BaseRedisSchema(ModelSchema):
    """
    Base team schema exposes only the most general fields.
    """

    class Meta:
        # pylint: disable=missing-docstring
        model = Redis
        fields = (
            Redis.id.key,
            Redis.name.key,
            Redis.port.key,
        )
        dump_only = (
            Redis.id.key,
        )


class RedisOperationSchema(BaseResultSchema):
    result = base_fields.String()
